package com.gagakuai.engine.impl.pvm.runtime;

import com.gagakuai.engine.impl.pvm.PvmEvent;
import com.gagakuai.engine.impl.pvm.process.ScopeImpl;
import com.gagakuai.engine.impl.runtime.InterpretableExecution;

import java.awt.desktop.AppForegroundListener;

/*
 * @program: common-starters
 * @description:
 * @author: houhong
 * @create: 2023-04-30 16:12
 */
public class AtomicOperationTransitionNotifyListenerEnd extends AbstractEventAtomicOperation {

    @Override
    protected ScopeImpl getScope(InterpretableExecution execution) {
        return (ScopeImpl) execution.getActivity();
    }

    /*
     *  设置完成事件
     */
    @Override
    protected String getEventName() {
        return PvmEvent.EVENTNAME_END;
    }

    @Override
    protected void eventNotificationsCompleted(InterpretableExecution execution) {

        //执行下一个
        execution.performOperation(TRANSITION_DESTROY_SCOPE);
    }
}